<?php

namespace App\Http\Controllers\Home;
use Illuminate\Http\Request;
use DB;
use App\Http\Requsets;
use App\Http\Controllers\Controller;

class GoodsController extends Controller{
	
	public function getIndex(Request $request){

		$gid = $request->input('gid');
		
		$shop_goods = DB::table('shop_goods')->where('gid',$gid)->first();
		
		//$goods = DB::table('shop_goods')
		     //   ->join('cate','shop_cate.cid','=','shop_goods.cate_cid')
		     //   ->select('shop_goods.*','shop_cate.name as names')
		      //  ->where('shop_goods.gid',$gid)
		       // ->first();
          //  dd($goods);
		$id=1;
        $user= DB::table('shop_users')->where('id',$id)->first();
      
		        //读取当前分类商品
		    
		return view('Home.goods.index',['shop_goods'=>$shop_goods,'user'=>$user]);
	}
}

